<%@ taglib prefix="iwebmvc" uri="http://tags.iwebmvc.com" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt" %>
<c-rt:set var="pollClass" value="<%= org.internna.iwebmvc.model.Poll.class %>" />
<c-rt:set var="sessionUser" value="<%= org.internna.iwebmvc.security.UserManager.SESSION_USER %>" />
<c-rt:set var="authorities" value="<%= org.internna.iwebjtracker.spring.mvc.IWebJTrackerModelDecoratorInterceptor.AUTHORITIES %>" />
<iwebmvc:panel title="ui.administration.users" width="98%;margin-right:10" cssStyle="text-align:left;height:358px;">
    <iwebmvc:usermanager rows="7" pages="5" authorities="${requestScope[authorities]}" />
</iwebmvc:panel>
<div class="panelSeparator"></div>
<iwebmvc:panel title="ui.administration.polls" width="98%;margin-right:10" cssStyle="text-align:left;height:358px;">
    <iwebmvc:paginggrid id="adminPollGrid" entityClass="${pollClass}" pages="5" rows="8" baseColumnWidth="100" selectionMode="single">
        <div class="overclear">
            <div class="float_left">
                <iwebmvc:sprite id="adminPollAdd" text="iwebmvc.ui.crud.add;${pollClass.name}" sprite="table_${sessionScope[sessionUser].theme}.png" top="-50px" position="after">
                    openAndClearPollAdminForm();
                </iwebmvc:sprite>
            </div>
            <div class="float_right">
                <iwebmvc:sprite id="adminPollEdit" text="iwebmvc.ui.crud.edit;${pollClass.name}" sprite="table_${sessionScope[sessionUser].theme}.png" top="-500px" style="opacity:0.4;" position="before">
                    editAdminPoll();
                </iwebmvc:sprite>
                <iwebmvc:sprite id="adminPollToggle" text="ui.administration.polls.toggle" sprite="table_${sessionScope[sessionUser].theme}.png" top="-550px" style="opacity:0.4;" position="below">
                    toggleAdminPoll();
                </iwebmvc:sprite>
            </div>
        </div>
    </iwebmvc:paginggrid>
</iwebmvc:panel>
<iwebmvc:popup id="createAdminPoll" title="ui.administration.polls.add">
    <span style="display:inline-block;width:90px">
        <iwebmvc:checkbox id="adminPoll" entityClass="${pollClass}" path="active" postLabel="false" />
    </span>
    <iwebmvc:poll-admin id="_adminPoller" path="global" />
    <div style="text-align:right;padding-top:5px">
        <span id="pollValidationWarningContainer" class="validationWarning"></span>
        <span id="pollLoadingContainer" style="display:none"><img src='<c:url value="resource.iwebmvc?file=images/loading.gif" />' alt='' /></span>
        <iwebmvc:button buttonId="createPollButton" label="ui.administration.polls.save" buttonIcon="/resource.iwebmvc?file=/images/poll_${sessionScope[sessionUser].theme}.png">
            saveAdminPoll();
        </iwebmvc:button>
    </div>
</iwebmvc:popup>
<script type="text/javascript">
    dojo.addOnLoad(adminOnLoad);
</script>